﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MvvmLightDemo.ViewModels
{
    public class SubViewModel : ObservableObject
    {
		private string msg = "窗口开始展示";
        public string Msg
		{
			get { return msg; }
			set 
			{
				Set(ref msg,value);
			}
		}

        public SubViewModel()
        {
            Messenger.Default.Register<string>(this, "Msg", ReceiveMsg);
        }

        private void ReceiveMsg(string obj)
        {
            msg = obj;
        }
    }
}
